module.exports = {
  base: '/do-vue-docs-v2/',//github部署路径，本地开发和打包可移除
  title: 'doVue',
  description: 'vue 基础框架说明文档',
  locales: {
    '/': {
      lang: 'zh-CN'
    }
  },
  head: [
    ['link', { rel: 'icon', href: '/logo.ico' }]
  ],
  themeConfig: {
    nav: [
      { text: '首页', link: '/' },
      { text: '指南', link: '/guide/' },
      { text: '组件', link: '/components/' },
      { text: '工具', link: '/tools/' },
      { text: '样式', link: '/sass/' },
      { text: 'eslint', link: '/eslint/' },
      { text: '关于我们', link: '/about/' },
      { text: '1.X', link: 'http://yexiaodong.gitee.io/do-vue-docs-v1/' },
    ],
    //sidebar: 'auto',
    sidebar: {
      '/guide/': getGuideSidebar(),
      '/components/': getComponentsSidebar(),
      '/tools/': getToolsSidebar(),
      '/sass/': getSassSidebar(),
      '/eslint/': getESLintSidebar(),
      '/about/': getAboutSidebar(),
    }

  },


}

function getGuideSidebar() {
  return [
    {
      title: '指南',
      collapsable: false,
      children: [
        '',
        'order',
        'directory',
        'name',
        'restful',
        'avert',
      ]
    }
  ]
}

function getComponentsSidebar() {
  return [
    {
      title: '组件',
      collapsable: false,
      children: [
        '',
        'layout',
        'item',
      ]
    },
  ]
}

function getToolsSidebar() {
  return [
    {
      title: '工具',
      collapsable: false,
      children: [
        '',
        'do',
        'http',
        'storage',
        'tips',
      ]
    },
    {
      title: '路由守卫',
      collapsable: false,
      children: [
        'guard',
        'guardKeepAlive'
      ]
    }
  ]
}

function getSassSidebar() {
  return [
    {
      title: '样式',
      collapsable: false,
      children: [
        '',
        'reset',
        'mixin',
        'do',
      ]
    }
  ]
}

function getESLintSidebar(){
  return [
    {
      title: 'eslint',
      collapsable: false,
      children: [
        '',
        'base',
        'base3',
        'base2',
      ]
    }
  ]
}

function getAboutSidebar() {
  return [
    {
      title: '关于我们',
      collapsable: false,
      children: [
        '',
        'demo',
        'plan',
        'changelog',
      ]
    }
  ]
}